package com.xiaoshuidi.cloud.module.finance.enums.merchant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum ReviewStatusEnum {

    SUCCESS(2,"审核成功"),
    FAILURE(3,"审核失败");

    private final Integer code;
    private final String name;

    public static boolean isSuccess(String status) {
        return Objects.equals(status, SUCCESS.name());
    }

    public static boolean isSuccess(ReviewStatusEnum status) {
        return SUCCESS == status;
    }

    public static String getDesc(String name) {
        for (ReviewStatusEnum value : values()) {
            if (value.name().equals(name)) {
                return value.getName();
            }
        }
        return "";
    }
}
